<?php
header('Content-Type:text/html;charset=gbk');
require '../../packages/connect_database.php';
mysql_select_db("auction");
$number = $_GET["number"];
$query = mysql_query("SELECT * FROM waiting");
if(mysql_num_rows($query) == 0) {
	mysql_query("DELETE FROM auction WHERE number = {$number}");
	exit();
}
$result = mysql_fetch_row($query);
$update = "UPDATE auction SET title = '{$result[0]}',name = '{$result[1]}',phone = '{$result[2]}',";
for($i = 1;$i <= 6;$i++)
	$update .= "img{$i} = '{$result[$i + 2]}',";
$update .= "info = '{$result[9]}',price = '',offerer = '',offer = '' WHERE number = {$number}";
mysql_query($update);
mysql_query("DELETE FROM waiting WHERE phone = '{$result[2]}' AND title = '{$result[0]}'");
mysql_query("DELETE FROM auction WHERE number = {$number} AND title = ''");
